package com.scut.fy.notice.controller;

import com.scut.fy.notice.model.vo.EmailSendVo;
import com.scut.fy.notice.service.EmailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @author JY
 * @version 1.0
 * @date 2021/10/8
 */
@Api(value = "发送邮件接口")
@RestController
@RequestMapping("/email")
public class EmailController {
    @Autowired
    private EmailService emailService;

    @ApiOperation(value = "发送简单的邮件信息")
    @PostMapping("/sendSimpleMail")
    public void sendSimpleMail(@RequestBody EmailSendVo emailSendVo) {
        emailService.sendSimpleMail(
                emailSendVo.getSubject(),
                emailSendVo.getText(),
                emailSendVo.getTo());
    }
}
